/**
 * 用于记录插针的上下文数据
 */
import {IEntity} from "./IEntity";
import {Position} from "./Position";
import {Orientation} from "./Orientation";

export class RenderFrameInsertContextHolder {


  constructor(countRelease: number) {

    this.countRelease = countRelease;
  }

  //还要插入多少帧
  countRelease: number;
  positionHolder: Map<IEntity, Position> = new Map<IEntity, Position>();
  orientationHolder: Map<IEntity, Orientation> = new Map<IEntity, Orientation>();

  getCurrentStepPercent() {
    return Math.max(this.countRelease,1);
  }

  walk() {
    this.countRelease--;
  }

  isFinish() {
    return this.countRelease <= 0;
  }
}
